package models

import "demo/device-hub/constants/types"

//go:generate tools gen model2 DeviceAdditional --database DBVideoHub --with-comments
// 设备额外信息表
// @def primary ID
type DeviceAdditional struct {
	PrimaryID
	RefDeviceAdditionalID
	RefDeviceAdditionalInfo
	OperationTimesWithDeletedAt
}

type DeviceAdditionalID = SFID

type RefDeviceAdditionalID struct {
	// @rel DeviceAdditional.DeviceAdditionalID
	// 额外信息ID
	DeviceAdditionalID DeviceAdditionalID `db:"f_device_additional_id" json:"deviceAdditionalID,omitempty"`
}

type RefDeviceAdditionalInfo struct {
	RefDeviceID
	// 标签键
	TagKey types.AdditionalType `db:"f_tag_key" json:"tagKey" sql:"varchar(128) NOT NULL"`
	// 标签值
	TagValue string `db:"f_tag_value" json:"tagValue" sql:"varchar(128) NOT NULL"`
}
